import { nextTick, onMounted, onUnmounted, ref } from 'vue'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'

const chartEditStore = useChartEditStore()
export const useLayout = () => {
  // * 监听缩放
  let removeListenScale: () => void
  const getDomById = (id: string): HTMLElement | null => {
    return document.getElementById(id)
  }
  onMounted(() => {
    chartEditStore.setEditCanvas('editLayoutDom', getDomById('simba-edit-layout'))
    chartEditStore.setEditCanvas('editContentDom', getDomById('simba-edit-content'))
    removeListenScale = chartEditStore.listenScale()
  })
  onUnmounted(() => {
    chartEditStore.setEditCanvas('editLayoutDom', null)
    chartEditStore.setEditCanvas('editContentDom', null)
    removeListenScale()
  })

  return {
  }
}